package com.egghiro.j2se.game.sace.model.actor.bullet;

import java.awt.Color;

import com.egghiro.framework.j2se.game.core.model.actor.IActor2D;
import com.egghiro.framework.j2se.game.core.view.SImage;
import com.egghiro.framework.j2se.game.model.element.LinearVelocity2D;
import com.egghiro.j2se.game.sace.state.actorstate.FlyerForwardState;

public class ForwardBullet extends Bullet {
    private static final double DEFAULT_SPEED = 5;
    private static final SImage IMG = SImage.createImage(10, 10);
    static {
        IMG.getSGraphics().setColor(Color.GRAY);
        // IMG.getSGraphics().fillArc(0, 0, IMG.getWidth(), IMG.getHeight(), 0,
        // 360);
        IMG.getSGraphics().fillRect(0, 0, IMG.getWidth(), IMG.getHeight());
    }

    // private static final SImage IMG =SImage.createImage(PropertyUtils
    // .getAIMPropertyValue(SACEConst.AMI_P_Key_IMG_REIMU_FU));

    public ForwardBullet(int x, int y, double angle, IActor2D target, long life) {
        this(x, y, DEFAULT_SPEED, angle, target, life);
    }

    public ForwardBullet(int x, int y, double speed, double angle, IActor2D target, long life) {
        this(x, y, new LinearVelocity2D(speed, angle), target, life);
    }

    public ForwardBullet(int x, int y, LinearVelocity2D speed, IActor2D target, long life) {
        super(x, y, ForwardBullet.IMG, target, life);
        setState(new FlyerForwardState(this, speed));
    }
}
